package com.zhuzhe.blog.oauth2.config;


import com.zhuzhe.blog.password.AESUtil;
import com.zhuzhe.blog.password.MD5Util;
import com.zhuzhe.blog.password.RSAUtils;
import lombok.SneakyThrows;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.password.PasswordEncoder;

public class MyPasswordEncoder implements PasswordEncoder{



    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        return encodedPassword.equals(AESUtil.encodeBase64((String)rawPassword));
    }


    @Override
    public String encode(CharSequence rawPassword) {
        return AESUtil.encodeBase64(rawPassword.toString());
    }

}
